package study.java.jdk.jdk8._1_stream.collectors.counting;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import study.java.jdk.jdk8.DataUtils;
import study.java.jdk.jdk8.User;

import java.util.List;
import java.util.stream.Collectors;

@Slf4j
public class counting_Test {

    private List<User> userLt = DataUtils.buildUserLt();

    /**
     * @param mapper     -Function（映射器）
     * @param downstream -Collector（收集器）
     */
    @Test
    public void test() {
        Long count = userLt.stream()
                .collect(Collectors.counting());
        log.info("{}", count);
    }
}
